{extend name="base" /}
{block name="body"}
	<!--headlogo start-->
    <div class="head_logo">
    	<img src="__STATIC__/zjs/images/bg_logo_02.jpg" alt="" width="100%">
    </div>
    <!--headlogo end-->
    <!--推荐 start-->
    <div class="recommend">
        <form method="post" class="recommend_form" action="{:url('react')}" id="form1">
            <input type="hidden" value="{$Think.session.user_id}" name="user_id">
    		<div class="input_div">
    			<img src="__STATIC__/zjs/images/r_icon_05.png" alt="">
    			<span>姓名<small>（Name）</small></span>
    			<input type="text" placeholder="必填" name="name">
    		</div>
    		<div class="input_div">
    			<img src="__STATIC__/zjs/images/r_icon_11.png" alt="">
    			<span>电话<small>（Photo）</small></span>
    			<input type="text" placeholder="必填" name="tel" id="tel">
    		</div>
			<!--<div class="input_div">-->
				<!--<label class="per_m_radio a"><input type="radio" name="zhiding" value="1">不指定</label>-->
				<!--<label class="per_w_radio b"><input type="radio" name="zhiding" value="2">指定</label>-->
			<!--</div>-->
			<div class="input_div">
				<span>备注<small>（mark）</small></span>
				<input name="bz" type="text">
			</div>
            <button class="btn_submit" type="button" id="button">推荐</button>
    	</form>
    	<div>
    		<img src="__STATIC__/zjs/images/r_bg_02.jpg" alt="" width="100%">
    	</div>
    </div>
    <!--推荐 end-->
     {/block}
{block name="script"}
<script src="__STATIC__/zjs/layer/mobile/layer.js" type="text/javascript"></script>

<!--<script>-->
	<!--$("#tel").blur(function(){-->
		<!--$.post("{:url('getPhone')}", {phone:$("#tel").val()},function(vo){-->
			<!--if(vo.status == 0){-->
				<!--layer.open({content: vo.msg,skin: 'msg',time: 4});-->
				<!--$('#button').attr("disabled","false"); //禁止点击-->
			<!--}else{-->
				<!--$('#button').removeAttr("disabled"); //打开点击-->
			<!--}-->
		<!--});-->
	<!--});-->
<!--</script>-->

<script type="text/javascript">
   $(function(){
       $("#button").click(function(){
           $(this).hide();
           var name = $("input[name='name']").val();
           var tel = $("input[name='tel']").val();
           var reg=/^[\u4e00-\u9fa5]+$/;
           if(name != '' && tel != '') {
               if(reg.test(name)){
                   var reg = /^1\d{10}$/;
                   if(!reg.test(tel)) {
                       alert("电话格式不正确!");
                   } else {
                       var index =layer.open({
						   type: 2,
                           content: '努力加载中...'
                       });
                       $.ajax({
                           url:"{:url('react')}",
                           type: "post",
                           data: $("#form1").serialize(),
                           success: function (info) {
                               layer.close(index);
                               if (info.code === 1) {
                                   setTimeout(function () {
                                       location.href = info.url;
                                   }, 1000);
                               }
                               layer.open({
                                   content: info.msg
                                   ,skin: 'msg'
                                   ,time: 4 //2秒后自动关闭
                               });
                               $("#button").show();
                           }
                       });
                       return false;
                   }
               }else{
                   alert("姓名需要填写中文！");
			   }
		   }else {
               alert("请填写信息以方便联系！");
		   }
           layer.closeAll();
           $(this).show();
       });
       //选择
       $('input[type="radio"]:checked').css({"background":"url(__STATIC__/zjs/images/check_07.png)","background-size":"25px 26px"});
       $(".a").click(function(){
           $(this).children("input").css({"background":"url(__STATIC__/zjs/images/check_07.png)","background-size":"25px 26px"});
           $(this).siblings("label").children("input").css({"background":"url(__STATIC__/zjs/images/check_09.png)","background-size":"25px 26px"});
           $('#zhiding').hide();
           $('#zhiding input').removeAttr('name');
       })
       $(".b").click(function(){
           $(this).children("input").css({"background":"url(__STATIC__/zjs/images/check_07.png)","background-size":"25px 26px"});
           $(this).siblings("label").children("input").css({"background":"url(__STATIC__/zjs/images/check_09.png)","background-size":"25px 26px"});
           $('#zhiding').show();
           $('#zhiding input').attr('name','bz');
       })
   });
    </script>
{/block}